import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBTest {
	
	private String user;
	private String pw;
	private String url;
	private Connection connection;
	
	public DBTest() {
		user = "root";
		pw = "roto12";
		url = "jdbc:mysql://localhost/test?user";
		connect();
	}
	
	public void connect() {
		
		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException cnfe) {
			System.out.println("there is no mysql driver");
		} 
		try {
			connection = DriverManager
					.getConnection(url, user, pw);
		}
		catch (SQLException sqle) {
			sqle.printStackTrace();
			System.out.println("connection fail");
		}

		System.out.println("connection complete");
	}
}
